﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MasterPage.Master" Inherits="System.Web.Mvc.ViewPage<FrasesSimpsonsMvc.Models.Frases>" %>
<%@ Import Namespace="FrasesSimpsonsMvc.Views" %>

<asp:Content ID="Head" ContentPlaceHolderID="HeadContent" runat="server">
	<meta property="og:title" content="<%= Html.Encode(Model.DescripcionCorta) %>"/> 
	<meta property="og:type" content="video"/> 
	<meta property="og:image" content="<%= Model.Imagenes.Count > 0 ? Model.Imagenes.First().Link : string.Empty %>"> 
	<meta property="og:video" content="<%= Model.Videos.Count > 0 ? Html.VideoUrl(Model.Videos.First().Link) : string.Empty %>"> 
	<meta property="og:video:type" content="application/x-shockwave-flash"> 
	<meta property="og:url" content="<%= HttpContext.Current.Request.Url %>"/> 
	<meta property="og:site_name" content="Los matados - Frases de los simpsons"/> 
	<meta property="fb:admins" content="<%= FrasesSimpsonsMvc.Models.Settings.FacebookAdminId %>"/> 
	<meta property="og:description" content="<%= Html.Encode(Model.Dialogo) %>"/> 
</asp:Content>

<asp:Content ID="Title" ContentPlaceHolderID="TitleContent" runat="server"><%= Html.Encode(Model.DescripcionCorta) %></asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="MainContent" runat="server">
	<% Html.RenderPartial("SearchCleanUserControl"); %>

	<div class="row-responsive">
		<ul class="breadcrumb">
			<li>
				<a href="<%= Url.Action("Index", "Home") %>">Home</a> <span class="divider">/</span>
			</li>
			<% if (Model.Capitulos != null) { %>
			<li>
				<span class="label label-success tall"><a class="label-link" href="<%= Url.Action("Detail", "Temporada", new { Id = Model.Capitulos.Temporadas.Id}) %>">Temporada <%= Model.Capitulos.Temporadas.Numero %></a></span> <span class="divider">/</span>
			</li>
			<li>
				<span class="label label-inverse tall"><a class="label-link" href="<%= Url.Action("Detail", "Capitulo", new { Id = Model.Capitulos.Id }) %>">Capítulo <%= Model.Capitulos.Numero %></a></span> <span class="divider">/</span>
			</li>
			<% } %>
			<li class="active"><%= Model.DescripcionCorta %></li>
		</ul>
	</div>

	<div class="row-responsive well">

		<h1><%= Html.Encode(Model.Descripcion) %></h1>
		<% if (Model.Capitulos != null) { %>
		<h2><a href="<%= Url.Action("Detail", "Capitulo", new { Id = Model.Capitulos.Id }) %>"><%= Model.Capitulos.Nombre %></a><% if (Model.Tiempo != null) { %> a los <%= Model.TiempoMostrable %><% } %></h2>
		<span class="label label-inverse tall"><a class="label-link" href="<%= Url.Action("Detail", "Capitulo", new { Id = Model.Capitulos.Id }) %>">Capítulo <%= Model.Capitulos.Numero %></a></span>&nbsp;<span class="label label-success tall"><a class="label-link" href="<%= Url.Action("Detail", "Temporada", new { Id = Model.Capitulos.Temporadas.Id}) %>">Temporada <%= Model.Capitulos.Temporadas.Numero %></a></span>
		<% } %>
		<div class="hidden-phone top-space-mini">
			<a class="btn btn-primary" href="http://api.addthis.com/oexchange/0.8/forward/twitter/offer?url=<%= Html.Encode(FrasesSimpsonsMvc.Models.Settings.SitePublicUrl + Url.Action("Detail", "Frase", new { Id = Model.Id })) %>&template=<%= Html.Encode(string.Format("\"{0}\" en %23losmatados {1}{2}", Model.DescripcionCorta, FrasesSimpsonsMvc.Models.Settings.SitePublicUrl, Url.Action("Detail", "Frase", new { Id = Model.Id }))) %>" target="_blank"><i class="icon-retweet icon-white"></i> Twittear</a>
			<a class="btn btn-primary" href="javascript:var d=document,f='http://www.facebook.com/share',l=d.location,e=encodeURIComponent,p='.php?src=bm&v=4&i=1298517491&u='+e(l.href)+'&t='+e(d.title);1;try{if (!/^(.*\.)?facebook\.[^.]*$/.test(l.host))throw(0);share_internal_bookmarklet(p)}catch(z) {a=function() {if (!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=1,width=626,height=436'))l.href=f+p};if (/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}}void(0)" id="share_bookmark" title="Share on Facebook"><i class="icon-thumbs-up icon-white"></i> Compartir en Facebook</a>
			<a class="btn btn-danger" href="<%= Url.Action("Delete", "Frase", new { Id = Model.Id }) %>"><i class="icon-trash icon-white"></i> Eliminar</a>
			<a class="btn" href="<%= Url.Action("Edit", "Frase", new { Id = Model.Id }) %>"><i class="icon-pencil"></i> Editar</a>
			<% if (ViewData["SiguienteId"] != null) { %><a href="<%= Url.Action("Detail", "Frase", new { Id = ViewData["SiguienteId"] }) %>" class="btn">Siguiente <i class="icon-forward"></i></a><% } %>
		</div>
	</div>

	<div class="visible-desktop row-responsive">
		<div class="ads-upper-main">
			<script type="text/javascript">
			<!--
				google_ad_client = "ca-pub-3817233705926458";
				google_ad_slot = "8498965180";
				google_ad_width = 728;
				google_ad_height = 90;
			//-->
			</script>
			<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
		</div>
	</div>

	<div class="row-fluid top-space-mini">

		<div class="span6 pull-rigth">

			<h3>Videos</h3>
			<% bool first = true; %>
			<% foreach (var video in Model.Videos) { %> 
				<% if (first) { %>
					<% first = false; %>
					<div class="frase-video"><%= Html.EmbedVideo(video.Link, true)%></div>
				<% } %>
				<% else { %>
					<div class="frase-video"><%= Html.EmbedVideo(video.Link)%></div>
				<% } %>
			<% } %>

			<h3 class="top-space">Imagenes</h3>
			<div id="myCarousel" class="carousel slide carousel-images">
				<!-- Carousel items -->
				<div class="carousel-inner">
				<% foreach (var imagen in Model.Imagenes) { %>
					<div class="item"><img src="<%= Html.Encode(imagen.Link) %>" alt="<%= Html.Encode(Model.DescripcionCorta) %>"/></div>
				<% } %>
				</div>
				<% if (Model.Imagenes.Count > 1) { %>
				<!-- Carousel nav -->
				<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
				<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
				<% } %>
			</div>

		</div>
		
		<div class="span6 pull-rigth">
		
			<h3>Posteado</h3>
			<span>El <strong><%= Model.Fecha.ToShortDateString() %></strong> a las <strong><%= Model.Fecha.ToShortTimeString() %></strong> <% if (Model.Posteador != null) { %> por <strong><%= Model.Posteador %><% } %></strong></span>

			<h3 class="top-space">Dialogo</h3>
			<% if (Model.Dialogo != null) { %>
				<% foreach (var line in Model.Dialogo.Split('|')) { %>
					<%= Html.Encode(line) %><br />
				<% } %>
			<% } %>

			<h3 class="top-space">Personajes</h3>
			<% foreach (var personaje in Model.Personajes) { %>
			<span class="label label-info tall"><a class="label-link" href="<%= Url.Action( "Detail", "Personaje", new { Id = personaje.Id })%>"><%= personaje.Nombre %></a></span>
			<% } %>
			<% if (Model.Personajes.Count == 0) { %>
			<span class="label tall">Sin personajes</span>
			<% } %>

			<h3 class="top-space">Keywords</h3>
			<% if (!string.IsNullOrEmpty(Model.Keywords)) { %>
				<% foreach (var keyword in Model.Keywords.Replace(",", "").Split(' ')) { %>
					<% if (keyword.Trim() != string.Empty) { %>
						<span class="label"><%= keyword.Trim() %></span>
					<% } %>
				<% } %>
			<% } %>
			<% else { %>
				<span class="label">Sin keywords</span>
			<% } %>
		</div>

	</div>

	<div class="row-fluid top-space">
		<h3>Comentarios</h3>
		<fb:comments href="<%= FrasesSimpsonsMvc.Models.Settings.SitePublicUrl %><%= Url.Action("Detail", "Frase", new { Id = Model.Id }) %>" numposts="10" width="425" publish_feed="false"></fb:comments>
	</div>

	<script type="text/javascript">
		$(document).ready(function () {
			var url = '#<%= Model.DescripcionUrl %>';
			if (window.location.href.indexOf(url) == -1) {
				window.location.href += url;
			}
			$('.carousel').carousel('next');
		});
	</script>
</asp:Content>

